﻿// code06010100.cpp : 函数基础
// 静态局部对象

#include <iostream>
using namespace std;

//计算调用函数的次数
size_t count_calls()
{
	static size_t ctr = 0;
	return ++ctr;
}

int main()
{
    for (size_t i=0;i!=10;++i)
    {
		cout << count_calls() << endl;
    }
	return 0;
}

